from django.db import models

class Zone(models.Model):
    forward_lookup = models.BooleanField() #if false - revers lookup
    name = models.TextField()
    serial_number = models.TextField()
    refresh_time = models.TextField()
    retry_time = models.TextField()
    expire_time = models.TextField()
    minimum_ttl = models.TextField()
    source_host = models.TextField()
    contact_email = models.TextField()
    creation = models.DateTimeField()
    enabled = models.BooleanField()

class RecordClass(models.Model):
    name = models.TextField()

class Record(models.Model):
    name = models.TextField()
    value = models.TextField()
    zone = models.ForeignKey(Zone)
    record_class = models.ForeignKey(RecordClass)
    creation = models.DateTimeField()
    enabled = models.BooleanField()
    
class User(models.Model):
    name = models.TextField()
    password = models.CharField(max_length=32)
    creation = models.DateTimeField()
    enabled = models.BooleanField()

class LogAction(models.Model):
    name = models.TextField()

class LogMessage(models.Model):
    name = models.TextField()
    description = models.TextField()
    action = models.ForeignKey(LogAction)
    user = models.ForeignKey(User)
    creation = models.DateTimeField()
    ip = models.IPAddressField()